package cheqex.update;

import javax.swing.*;
import javax.swing.table.DefaultTableModel;

import cheqex.dao.DepositCash;
import cheqex.dao.DepositCashPeer;
import cheqex.update.controllers.DateController;

import java.awt.Dimension;
import java.util.List;

public class CashInBankView extends JPanel{
	
	private JSplitPane splitPaneWeekly;
	private JSplitPane sp;
	private JScrollPane scrollPane1;
	private JScrollPane scrollPane2;
	private JScrollPane scrollPane3;
	public JTable table;
	
	public CashInBankView(){
		initialize();
	}
	
	public void populateTable(String[][] obj, String[] col){
		this.table.setModel(new DefaultTableModel(obj, col));
		this.table.getTableHeader().setReorderingAllowed(false);
		this.table.setVisible(true);
	}
	
	/*	initialize
	 * 	----------
	 * 	AUTHOR: Patrisha Louisse O Sales
	 * 	initialize initializes the components of the
	 * 	CashInBankView		*/
	public void initialize(){
		this.table = new JTable();
		this.table.setFillsViewportHeight(true);
		this.table.setShowGrid(true);
		this.table.setOpaque(true);
	    this.table.setAutoResizeMode(5);
	    this.table.setRowHeight(24);
	    this.table.setEnabled(false);
	    
		this.scrollPane1 = new JScrollPane(new SummaryView());
		this.scrollPane2 = new JScrollPane(new FilterSearchView(this));
		this.scrollPane3 = new JScrollPane(this.table);		
						
    	scrollPane1.setMinimumSize(new Dimension(300, 600));	        
    	scrollPane2.setMinimumSize(new Dimension(150, 100));
		
		this.sp = new JSplitPane(JSplitPane.VERTICAL_SPLIT, scrollPane2, scrollPane3);
		sp.setOneTouchExpandable(false);
		sp.setDividerLocation(200);
		sp.setAutoscrolls(false);
		
		this.splitPaneWeekly = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT, scrollPane1, sp);
		splitPaneWeekly.setOneTouchExpandable(false);
		splitPaneWeekly.setDividerLocation(330);
		splitPaneWeekly.setAutoscrolls(false);
		splitPaneWeekly.setContinuousLayout(false);
		
		sp.setPreferredSize(new Dimension(400,400));	      
        splitPaneWeekly.setPreferredSize(new Dimension(950, 400));
        
        this.add(splitPaneWeekly);
        this.setVisible(true);
	}
	/*		END OF initialize		*/
}
	
	
	
	